#include "Interpolation.h"
#include <fstream>

double f(double x)
{
    return 1.0 / (1.0 + 25 * x * x);
}

int main()
{
    chebyshev C;
    vector<double> x;
    vector<double> fi;
    double x_i;

    pair<vector<double> *, vector<double> *> *p;
    vector<string> polys;

    for (int n = 5; n <= 20; n += 5)
    {
        p = C.Cheby_interpolation(f, n);
        polys.push_back(generate_poly_rat(*(p->first), *(p->second)));
    }

    ofstream out;
    out.open("./date/C.polynomials", ios::out);
    for (auto i : polys)
    {
        out << i << endl;
    }
    out.close();



    return 0;
}
